import axios from "axios";
import { useUserStore } from '@/store/user'
const user = useUserStore()

let post_config = {
 // headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${user.token}` }
 headers: {'Authorization': `Bearer ${user.token}` }
};

function uploadImg(param,url) {
  ///api/hcem/image
  return axios.post(url, param, post_config).then((res) => {
    return Promise.resolve(res.data);
  }).catch((err) => {
    return Promise.reject(err);
  });
}

export default uploadImg;